package com.joint.cloud.common.exception;

import com.joint.cloud.common.constants.ResponseCode;

public class BusinessException extends RuntimeException {

    private final ResponseCode code;

    private final String msg;

    public BusinessException(ResponseCode code) {
        super(code.getMsg());
        this.code = code;
        this.msg = null;
    }

    public BusinessException(ResponseCode code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public ResponseCode getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
